package tests.pages;

import net.thucydides.core.annotations.DefaultUrl;
import net.thucydides.core.pages.PageObject;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;


@DefaultUrl("http://82.200.2.19")

public class LoginPage extends PageObject {



        @FindBy(linkText="Connect with Facebook")
        private WebElement btnConnecntFb;

        @FindBy(id="email")
        private WebElement emailTxt;

        @FindBy(id="pass")
        private WebElement passwordTxt;

        @FindBy(name="login")
        private WebElement buttonLogin  ;



   public LoginPage(WebDriver driver) {
        super(driver);
  }


    public void btnConnecnt_Fb() {
        element(btnConnecntFb).click();
    }

    public void email_terms(String email) {
        element(emailTxt).type("dusia.iwanowa1988@yandex.ru");
    }
    public void passwordValue(String pass) {
        element(passwordTxt).type("89087921481");
    }

    public void login(){
        element(buttonLogin).click();  }

  //  public void elementRA()
   // {
  //           element(RecentElement).getText();
   // }
   /* public List<String> should_opening_page()    {

  WebElement selectedSuburb = getDriver().findElement(By.cssSelector("li.discover.menu-item"));
        WebElement results= selectedSuburb.findElement(By.tagName(word));
        return convert(results, toStrings());
  }
   public void should_opening_page()    {

       WebElement selectedSuburb = getDriver().findElement(By.cssSelector("li.discover.menu-item"));
     selectedSuburb.getAttribute(word);

   }    */
  //
   //public String getNamedUrl=("");

  // public List<String> getDefinitions() {
      //  WebElement definitionList = getDriver().findElement(By.className("greeting"));
      //  List<WebElement> results = definitionList.findElements(By.tagName("DIV"));
     //   return convert(results, toStrings());
   // }

   // private Converter<WebElement, String> toStrings() {
      //  return new Converter<WebElement, String>() {
      //      public String convert(WebElement from) {
       //         return from.getText();
      //      }
     //   };
 //   }
}


